prompt() Global Functionprompt(prompt, default) Description The prompt global function opens a dialog box with a text field into which the user can enter a text string. The text string is returned as a value, or is null if the dialog is cancelled. Parameters
Returns String, or null if dialog is cancelled. Read-only. Example // presuming a project loaded with at least one comp is open: var myCompItem = app.project.item(1); var newName = prompt( "What would you like to name the comp?"); // rename it if (newName) { //if the user cancels, newName is null myCompItem.name = newName; // newName now holds a string } |